package com.qf.pojo;

import com.qf.utils.DBUtils;

import java.sql.SQLException;

public class Teacher extends User {

    private int courseId;

    public Teacher() {
    }

    public Teacher(String username, String password, String name, String sex, int age, String photo, int courseId) {
        super(username, password, name, sex, age, photo);
        this.courseId = courseId;
    }



    public int getCourseId() {
        return courseId;
    }

    public void setCourseId(int courseId) {
        this.courseId = courseId;
    }

    @Override
    public String toString() {
        return "Teacher{" +
                "courseId=" + courseId +
                "} " + super.toString();
    }
    public static void main(String[] args) {
        for (int i = 0; i < 100; i++) {
            try {
                DBUtils.commonUpdate("insert into teacher(username,password,name,age,sex,courseId) values(?,?,?,?,?,?)", "teacher" + i, "123456", "老师" + i, 18, "男", 1);
            } catch (SQLException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
